#include <stdio.h>
#include "light.h"
#include "io_led.h"
#include "lsd.h"
#include "iic_led.h"
#include "iic_led_stm32.h"
#include "io_led_stm32.h"

int main(int argc, char**argv)
{

    IoLed light1;
    IoLedStm32 io_led_stm32;

    Lsd light2;

    IicLed light3;
    IicLedStm32 iic_led_stm32;
    int tmp; 

    init_io_led_stm32(&io_led_stm32);
    init_iic_led_stm32(&iic_led_stm32);

    io_led_init(&light1, (IoLed_i**) & (io_led_stm32.interface));
    lsd_init(&light2);
    iic_led_init(&light3, (IicLed_i**)&(iic_led_stm32.interface));

    light_get_state(&light1, &tmp);
    printf("light1 state = %d\n", tmp);
    light_get_state(&light2, &tmp);
    printf("light2 state = %d\n", tmp);
    light_get_state(&light3, &tmp);
    printf("light3 state = %d\n", tmp);

    light_on(&light1);
    light_on(&light2);
    light_on(&light3);
    light_get_state(&light1, &tmp);
    printf("light1 state = %d\n", tmp);
    light_get_state(&light2, &tmp);
    printf("light2 state = %d\n", tmp);
    light_get_state(&light3, &tmp);
    printf("light3 state = %d\n", tmp); 


    light_off(&light1);
    light_off(&light2);
    light_off(&light3);
    light_get_state(&light1, &tmp);
    printf("light1 state = %d\n", tmp);
    light_get_state(&light2, &tmp);
    printf("light2 state = %d\n", tmp);
    light_get_state(&light3, &tmp);
    printf("light3 state = %d\n", tmp); 
    return 0;   
}

